package com.quarters.service;

import com.github.binarywang.wxpay.bean.order.WxPayMpOrderResult;
import com.github.binarywang.wxpay.exception.WxPayException;
import com.quarters.bean.Article;
import com.quarters.bean.ArticleOrder;
import com.baomidou.mybatisplus.extension.service.IService;
import com.quarters.bean.layuiBean.ResultPage;
import com.quarters.bean.layuiBean.VoPage;
import me.chanjar.weixin.common.error.WxErrorException;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 文章和订单表 服务类
 * </p>
 *
 * @author 冯政尚
 * @since 2019-09-04
 */
public interface ArticleOrderService extends IService<ArticleOrder> {


    /**
     * @param voPage
     * @return 后台查询
     */
    ResultPage<ArticleOrder> selectMyPage(VoPage voPage,Long userId);
    ResultPage<ArticleOrder> selectMyPageAll(VoPage voPage);

    /**
     * @param userId
     * @param time
     * @return 根据当前用户今天发送多少次群发
     */
    List<ArticleOrder> selectByIdTime(Long userId,String time);

    /**
     * @param userId
     * @param createTime
     * @param
     * @param title
     * 文章审核失败 发送给对应的管理员
     */
    void error(Long userId,Long createTime,String title,int flag);

    /**
     * 支付
     */
    WxPayMpOrderResult successPay(ArticleOrder articleOrder ) throws WxErrorException, WxPayException;

    /**
     * 回调
     * @param myOrderId
     * @param wxOrderId
     * @param totalFee
     */
    void paySuccess(String myOrderId, String wxOrderId, String totalFee)  ;


    //给用户发送文章
   // void send(String myOrderId);


    /**
     * @param voPage
     * @return 查询订单
     */
    ResultPage<ArticleOrder> selectOrderAll(VoPage voPage,String time);
    ResultPage<ArticleOrder> selectOrder(VoPage voPage,Long userId,String time);

    //标签管理员查询订单
    ResultPage<ArticleOrder> selectLableOrder(VoPage voPage,Long userId,String time);



}
